package client.control;

import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.effect.Light;
import javafx.scene.input.MouseEvent;
import client.util.StageManager;

import java.awt.*;

public class NewFileNameController {
    public TextField fileName;
    public Label tipError;

    public void sureFileName(MouseEvent event) {
        if(fileName.getText().trim().isEmpty()) {
            tipError.setVisible(true);
        }
        else {
            StageManager.STAGE.get("newFileName").close();
            //删除map中的引用
            StageManager.STAGE.remove("newFileName");
            IndexController controller = (IndexController) StageManager.CONTROLLER.get("indexControl");
            controller.addFolder(fileName.getText().trim());
        }
    }
}
